package com.redisdemo.demo.util;

import java.io.IOException;
import java.util.List;

/**
 * @author
 */
public class TestRedisBQueue {



    public static void main(String[] args) {
        try {
            for(int i=0;i<2000;i++){
                //bpop("11");
                pop("11");
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    private static void bpop(String t) {
        List<String> bytes =JedisBUtil.brpop("x");
        try {
            for (String aByte : bytes) {
                if (aByte != null) {
                    System.out.println(t+"消费："+aByte+"---"+bytes.size());
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
        }

    }

    private static void pop(String t) {
        String s =JedisBUtil.rpop("x");
        try {
            System.out.println(t+"消费："+s);
        } catch (Exception e) {
            e.printStackTrace();
        }

    }
}
